﻿#region using statements

using AeonOfStrife.Combat;
using AeonOfStrife.Objects.Units;

using AeonOfStrifeDatatypes.Combat;

using Microsoft.Xna.Framework;

#endregion

namespace AeonOfStrife.Objects.Castle
{
	public class CastleAttackPoint : IAttackable
	{
		public CastleAttackPoint(Castle p_castle, Vector2 p_position) {
			Castle = p_castle;
			Position = p_position;
		}

		public Castle Castle { get; protected set; }

		#region IAttackable Members

		public int Hp {
			get { return Castle.Hp; }
		}

		public Vector2 Position { get; protected set; }

		public DamageValues Defense {
			get { return Castle.Defense; }
		}

		public EnemyPriority EnemyPriority {
			get { return Castle.EnemyPriority; }
			set { }
		}

		public event UnitDeathEvent ThrowDeathEvent {
			add { Castle.ThrowDeathEvent += value; }
			remove { Castle.ThrowDeathEvent -= value; }
		}

		public void OnAttacked(IAttacker p_attacker, DamageValues p_damage) {
			Castle.OnAttacked(p_attacker, p_damage);
		}

		public void RegisterAttacker(IAttacker p_attacker) {
			Castle.RegisterAttacker(p_attacker);
		}

		public void UnregisterAttacker(IAttacker p_attacker) {
			Castle.UnregisterAttacker(p_attacker);
		}

		#endregion
	}
}